package org.example.carsystem.service.impl;

import org.example.carsystem.domain.SysDictData;
import org.example.carsystem.domain.SysDictType;
import org.example.carsystem.domain.vo.DictTypeVo;
import org.example.carsystem.mapper.DictDataMapper;
import org.example.carsystem.mapper.DictTypeMapper;
import org.example.carsystem.service.DictTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class DictTypeServiceImpl implements DictTypeService {
    @Autowired
    private DictTypeMapper dictTypeMapper;
    @Autowired
    private DictDataMapper dictDataMapper;
    @Override
    public List<SysDictType> dictTypeSelect(String dictName,String dictType, String status, Date createStartTime, Date createEndTime) {
        return dictTypeMapper.dictTypeSelect(dictName,dictType,status,createStartTime,createEndTime);
    }

    @Override
    public List<DictTypeVo> dictTypeSelectAll() {
        return dictTypeMapper.dictTypeSelectAll();
    }

    @Override
    public List<SysDictType> listAll(SysDictType type) {
        return dictTypeMapper.listAll(type);
    }

    @Override
    public List<SysDictType> list() {
        return dictTypeMapper.list();
    }



    @Override
    public SysDictType selectById(Long dictId) {
        return dictTypeMapper.selectById(dictId);
    }

    @Override
    public Integer addtype(SysDictType type) {
        return dictTypeMapper.addtype(type);
    }

    @Override
    public Integer updatetype(SysDictType type) {
        return dictTypeMapper.updatetype(type);
    }

    @Override
    public Integer removetype(String dictType) {
        dictDataMapper.removedata(dictType);
        return dictTypeMapper.removetype(dictType);
    }
}
